package com.qdlc.p2p.dal.dto;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.qdlc.p2p.common.constant.Global;

/**
 * 文章排行
 *
 * @author liya
 * @version 1.1.0.0
 */
@Entity
@Table(name = Global.DB_PREFIX + "article_rank")
public class ArticleRank {

    /** 主键 */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;

    /** 文章 */
    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "article_id")
    private Article article;

    /** 日点击量 */
    private int dayClicks;

    /** 周点击量 */
    private int weekClicks;

    /** 月点击量 */
    private int monthClicks;

    /** 总点击量 */
    private int totalClicks;

    /** 修改时间 */
    private Date modifyTime;

    public ArticleRank() {
    }

    public ArticleRank(Article article, Date modifyTime) {
        this.article = article;
        this.modifyTime = modifyTime;
        this.dayClicks = 1;
        this.weekClicks = 1;
        this.monthClicks = 1;
        this.totalClicks = 1;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public Article getArticle() {
        return article;
    }

    public void setArticle(Article article) {
        this.article = article;
    }

    public int getDayClicks() {
        return dayClicks;
    }

    public void setDayClicks(int dayClicks) {
        this.dayClicks = dayClicks;
    }

    public int getWeekClicks() {
        return weekClicks;
    }

    public void setWeekClicks(int weekClicks) {
        this.weekClicks = weekClicks;
    }

    public int getMonthClicks() {
        return monthClicks;
    }

    public void setMonthClicks(int monthClicks) {
        this.monthClicks = monthClicks;
    }

    public int getTotalClicks() {
        return totalClicks;
    }

    public void setTotalClicks(int totalClicks) {
        this.totalClicks = totalClicks;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }
}